<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>页面跨域-test1</title>
</head>

<body>
    <iframe src="http://localhost:8080/html_review_code/test.html" frameborder="1"></iframe>
    <script>
        function reverseString(str) {
            let temp = '';
            let result = [];
            for (let i = 0; i < str.length; i++) {
                let c = str.charAt(i);
                if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
                    temp += c;
                } else {
                    if (temp !== '') {
                        result.push(temp);
                        temp = '';
                    }
                }
            }
            if (temp !== '') result.push(temp);
            let resultStr = '';
            for (let i = result.length - 1; i >= 0; i--) {
                resultStr += result[i] + ' ';
            }
            console.log(resultStr);
        };
        function reverseString2(str) {
            let strArr = str.split("[^a-zA-Z]+");
            console.log(strArr);
        };
        reverseString2('a bcd 7,9,sd,a');
    </script>
</body>

</html>